<template>
  <div class="Demo2">
      <h1>我是Demo2</h1>
      <button @click="sendCar">把车给Demo1</button>
      <Test/>
  </div>
</template>

<script>
import Test from './Test'
export default {
    name:'Demo2',
    components:{Test},
    data(){
        return{
            car:'奥迪RS7'
        }
    },
    mounted(){
        this.$bus.$emit('atguigu',this.car)
    }
}
</script>

<style>
.Demo2{
    background-color: skyblue;
    padding: 30px;
}
</style>